﻿using System;

namespace HEFramework
{
    public interface IAddChild
    {
    }

    public interface IAddChildSystem : ISystemType
    {
        void Run(Entity _parent, Entity _child);
    }

    [EntitySystem]
    public abstract class AddChildSystem<T> : IAddChildSystem where T : Entity, IAddChild
    {
        Type ISystemType.Type()
        {
            return typeof(T);
        }

        Type ISystemType.SystemType()
        {
            return typeof(IAddChildSystem);
        }

        int ISystemType.GetInstanceQueueIndex()
        {
            return InstanceQueueIndex.None;
        }

        void IAddChildSystem.Run(Entity _parent, Entity _child)
        {
            this.AddChild((T)_parent, _child);
        }


        protected abstract void AddChild(T _self, Entity _child);
    }
}